<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends HomeController
{

	//系统首页
    public function index()
    {

        $carousels = new \Document\Model\Carousel\Home\GetIndexCarouselModel();
        $carousel = $carousels->get();

        $index=D(Document);
        $condition1['category_id']=59;
        $condition1['status']=1;
        $news_list=$index->where($condition1)->field('id , cover_id , title , description')->order('id desc')->limit(6)->select();
		
		$condition['category_id']=69;
        $condition['status']=1;
        $introduce_id=$index->where($condition)->field('id')->order('id desc')->limit(1)->select();
	
		$content_article=D('DocumentContentArticle');
		$where['id']= $introduce_id[0]['id'];
		$introduce_article=$content_article->where($where)->field('content')->select();

		$this->assign('introduce_article',$introduce_article);//介绍内容
        $this->assign('carousel',$carousel);//轮播图片
        $this->assign('news_list',$news_list);//新闻标题

        $this->display();
    }



}